<?php
	include_once 'isLogin.php';
	
	$table_name = "explains";
	
	if($_POST['submit']){
		$arr = array('content'=>$_POST['content']);
		$commonc->update($table_name,$arr,"id=".$_GET['id']);
		
		echo $commonc->submitAlert('成功','explains.php?id='.$_GET['id']);
	}
	
	//编辑
	if($_GET['id']!=false){
		$explains=$commonc->getInfo($table_name,$_GET['id']);
	}
	
	$smarty->assign('explains',$explains);
	$smarty->display("explains.html");
?>